{% extends "index.html" %}
{% block css %}
    <style>
    </style>
{% endblock %}

{% block body %}
    <div>
        <p class="center">先登录</p>
        <div class="center">
            <input id="username" type="text" placeholder="随便输入名字">
            <br><br>
            <button style="width: 200px" onclick="login()">登录</button>
            <br><br>
            <p class="center" style="color: gray">随便输入名字，输入完自动注册用户</p>
        </div>
    </div>
{% endblock %}

{% block base_js %}
    <script>
        function login(){
            let username = $('#username').val()
            $.get('/?username='+username).then((res)=>{

                let data = JSON.parse(res)
                console.log(data.uid)
                let uri = '/sy/?uid='+data.uid
                window.open(uri,'_self')
            })
        }
    </script>
{% endblock %}

